package com.adonis.ejoy.Item;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Post {
    private Long uid;    //字段区分大小写，必须与json中的字段名一致
    private Long pid;
    private String name;
    private String img;
    private String text;
    private String photo;
    private Long time;    //设置为Long类型是因为GSON解析Date类型有问题
    private Long likes;
    private Boolean isLikeflag;
    private Boolean isFollowflag;
    private SimpleDateFormat format = new SimpleDateFormat("y-M-d H:m:s");

    public Long getUID() {
        return uid;
    }
    public void setUID(Long uID) {
        uid = uid;
    }
    public Long getPID() {
        return pid;
    }
    public void setPID(Long pid) {
        this.pid = pid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
    public String getText() {
        return text;
    }
    public void setText(String text) {
        this.text = text;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    public String getTime() {
        return format.format(new Date(time));
    }
    public void setTime(Long time) {
        this.time = time;
    }
    public Long getLikes() {
        return likes;
    }
    public void setLikes(Long likes) {
        this.likes = likes;
    }

    public Boolean getIsLikeflag() {
		return isLikeflag;
	}
	public void setIsLikeflag(Boolean isLikeflag) {
		this.isLikeflag = isLikeflag;
	}
	public Boolean getIsFollowflag() {
		return isFollowflag;
	}
	public void setIsFollowflag(Boolean isFollowflag) {
		this.isFollowflag = isFollowflag;
	}

    @Override
    public String toString() {
        return "Post{" +
                "uid=" + uid +
                ", pid=" + pid +
                ", name='" + name + '\'' +
                ", img='" + img + '\'' +
                ", text='" + text + '\'' +
                ", photo='" + photo + '\'' +
                ", time=" + time +
                ", likes=" + likes +
                ", isLikeflag=" + isLikeflag +
                ", isFollowflag=" + isFollowflag +
                ", format=" + format +
                '}';
    }
}
